//report fit of model with "other" moments, like LF frictions and lovenheim/hilger moments
import delimited "$dir/Model/simulated_data/simulated_data_base.csv", clear

//renaming
ren v1 theta
ren v2 e
ren v3 x
ren v4 a
ren v5 t
ren v6 p
ren v7 I
ren v8 H 
ren v9 tau
ren v10 s
ren v11 s_val
ren v12 prob_diff_I
ren v13 prob_diff_H
ren v14 l 
ren v15 m
ren v16 w
ren v17 tax
ren v18 c
ren v19 util
ren v20 switch
ren v21 gov_exp
ren v22 sim
ren v23 i_v

//labor force stickiness
su switch if e!=0 & t>22 & t<=60 //switch rate
su switch if e!=0 & t>22 & t<=60 & p==0 //switch rate -- joining
su switch if e!=0 & t>22 & t<=60 & (p==1 | p == 2) //switch rate -- joining

//employment persistence
su m if l == 1 & p == 2
local frac1 = 1 - `r(mean)'
su m if l == 1 & p !=2
local frac2 = 1 - `r(mean)'
local unemp_frac = `frac1' / `frac2'
di "`unemp_frac'"

tab m if l == 1 & p == 2 //probabiliyt of employment given supplying labor and being employed in previous period
//first pass: model just set this to one . . .

//Lovenheim moments
su prob_diff_H if H>0 & t == 22 //nails it.
su prob_diff_H if H>0 & H<1.75 & t == 22 //same story -- can't generate the degree of concentration of Lovenheim effect, but that's not surprising.
su prob_diff_H if H>0 & H>1.75 & t == 22 //same story -- can't generate the degree of concentration of Lovenheim effect, but that's not surprising.


//Hilger moment
su prob_diff_I if t == 22 //nails it. 

//wage ratios
gen theta_tercile = 1
replace theta_tercile = 2 if theta>0.33 & theta<0.66
replace theta_tercile = 3 if theta>0.66
keep if m == 1 //employed folks only!
keep if t>=24 & t<=34
collapse (mean) w, by(e theta_tercile)

reshape wide w, i(e) j(theta_tercile)
gen ratio = w3/w1 
drop w*
su ratio if e==1
su ratio if e==2
su ratio if e==3

//all done!

//end of dofile